問題描述
Postgres pg_dump 顯示空文件 (Postgres pg_dump show empty file)
我在 wamp 中使用此命令,但我得到空的 Mybackup.sql
文件,我知道我缺少什麼嗎?
<?php exec("pg_dump ‑U postgres taro‑api > Mybackup.sql"); ?>
參考解法
方法 1:
With the additional information from the comments, it becomes clear that you are on Windows and pg_dump
is not on your PATH
.
Either use the full absolute path for pg_dump
or add the directory to the PATH
environment variable.
(by Kamran Sohail、Laurenz Albe)